package nhatquang.gs.view;

import nhatquang.gs.controler.ScenesManager;

import org.andengine.entity.sprite.Sprite;
import org.andengine.input.touch.TouchEvent;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;

public class MySpriteMenuItem extends Sprite {
	private int level;

	public MySpriteMenuItem(float pX, float pY, float pWidth, float pHeight,
			ITextureRegion pTextureRegion,
			VertexBufferObjectManager pVertexBufferObjectManager,
			int numberLevel) {
		super(pX, pY, pWidth, pHeight, pTextureRegion,
				pVertexBufferObjectManager);
		this.level = numberLevel;
	}

	@Override
	public boolean onAreaTouched(TouchEvent pSceneTouchEvent,
			float pTouchAreaLocalX, float pTouchAreaLocalY) {
		ScenesManager.INSTAND.loadLeveltoPlayer(level);
		return super.onAreaTouched(pSceneTouchEvent, pTouchAreaLocalX,
				pTouchAreaLocalY);
	}

}
